package com.problem.leetcode;

/**
 * @author didi
 * @DESCRIPTION problem434
 * @create 2018-04-19 下午8:47
 **/

public class Problem434 {

    public int countSegments(String s) {
        String[] strings = s.split(" ");
        int      count   = 0;
        for (int i = 0; i < strings.length; i++) {
            if (!strings[i].trim().equals("")) {
                ++count;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        String[] strs = "f f  l".split(" ");
        for (int i = 0; i < strs.length; i++) {
            System.out.println(strs[i]);
        }
    }
}
